package com.kexinde.wjifen.model;

import java.util.Date;

import javax.persistence.Entity;

/**
 * 商家优惠活动
 * 
 * @author WEI
 *
 */
@Entity
public class Activity {

	/**
	 * 主键
	 */
	private Long id;
	
	/**
	 * 活动名称
	 */
	private String name = "";
	
	/**
	 * 活动介绍
	 */
	private String introduction = "";
	
	/**
	 * 活动图片路径
	 */
	private String pic = "";
	
	/**
	 * 商店id(外键)
	 */
	private Long shopId = 0L;
	
	/**
	 * 活动开始时间
	 */
	private Date startTime = new Date();
	
	/**
	 * 活动结束时间
	 */
	private Date endTime = new Date();
	
	/**
	 * 活动创建时间
	 */
	private Date insTime = new Date();
	
	/**
	 * 原价
	 */
	private Double oldPrice = 0.0;
	
	/**
	 * 现价
	 */
	private Double newPrice = 0.0;
	
	/**
	 * 构造方法
	 * 动态创建实例，用于数据库读写时，反射获取对象
	 * 
	 * @param id
	 * @param name
	 * @param introduction
	 * @param pic
	 * @param shopId
	 * @param startTime
	 * @param endTime
	 * @param insTime
	 * @param oldPrice
	 * @param newPrice
	 */
	public Activity(Long id, String name, String introduction, String pic,
			Long shopId, Date startTime, Date endTime, Date insTime,
			Double oldPrice, Double newPrice) {
		super();
		this.id = id;
		this.name = name;
		this.introduction = introduction;
		this.pic = pic;
		this.shopId = shopId;
		this.startTime = startTime;
		this.endTime = endTime;
		this.insTime = insTime;
		this.oldPrice = oldPrice;
		this.newPrice = newPrice;
	}

	/**
	 * 构造方法
	 * 动态创建实例，用于首页活动
	 * @param id
	 * @param name
	 * @param introduction
	 * @param pic
	 * @param shopId
	 */
	public Activity(Long id, String name, String introduction, String pic,
			Long shopId) {
		super();
		this.id = id;
		this.name = name;
		this.introduction = introduction;
		this.pic = pic;
		this.shopId = shopId;
	}



	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIntroduction() {
		return introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public Long getShopId() {
		return shopId;
	}

	public void setShopId(Long shopId) {
		this.shopId = shopId;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Date getInsTime() {
		return insTime;
	}

	public void setInsTime(Date insTime) {
		this.insTime = insTime;
	}

	public Double getOldPrice() {
		return oldPrice;
	}

	public void setOldPrice(Double oldPrice) {
		this.oldPrice = oldPrice;
	}

	public Double getNewPrice() {
		return newPrice;
	}

	public void setNewPrice(Double newPrice) {
		this.newPrice = newPrice;
	}

	/**
	 * 用于测试
	 */
	@Override
	public String toString() {
		return "Activity [id=" + id + ", name=" + name + ", introduction="
				+ introduction + ", pic=" + pic + ", shopId=" + shopId
				+ ", startTime=" + startTime + ", endTime=" + endTime
				+ ", insTime=" + insTime + ", oldPrice=" + oldPrice
				+ ", newPrice=" + newPrice + "]";
	}
	
}
